<HTML>
<HEAD>
<link rel=stylesheet type="text/css" href="styles.css">
<TITLE>Simkin Examples</TITLE>
</HEAD>
<BODY>

<H1>
Simkin Examples</H1>
<hr>
<p>
There are several examples included with this distribution. They are located in the <b>examples</b> sub-directory where you installed Simkin.
<ul>
<li><a href="examples/helloworld/HelloWorld.cpp.txt">HelloWorld</a> - a very simple example that prints "Hello World"
<p>
</li>
<li>Scriptloader - a small C++ program that loads an XML or TreeNode file whose name appears on the command line, and runs a method called <b>main</b> within it.<p>There are 4 flavours of this application:
<ol>
<li><a href="examples/scriptloader/ScriptLoader_TreeNode.cpp.txt">Scriptloader_TreeNode</a> - loads a <a href="../Simkin/TreeNode.html">TreeNode</a> file
<li><a href="examples/scriptloader/ScriptLoader_Expat.cpp.txt">ScriptLoader_Expat</a> - loads an XML file using the Expat parser and Simkin DOM classes</li>
<li><a href="examples/scriptloader/ScriptLoader_Xerces.cpp.txt">Scriptloader_Xerces</a> - loads an XML file using the Xerces library</li>
<li><a href="examples/scriptloader/ScriptLoader_MSXML.cpp.txt">Scriptloader_MSXML</a> - loads an XML file using the Microsoft MSXML library</li>
</ol>
<p>
You can use this to run the following example scripts:<p>
<ul>
<li><a href="examples/simple/Simple.xml.txt">Simple</a> - shows some simple Simkin script<p>To run this, change to the <b>examples\simple</b> directory and type:
<pre>
&lt;path-to&gt;Scriptloader Simple.xml
</pre>
</li>
<li><a href="examples/fieldaccess/FieldAccess.xml.txt">FieldAccess</a> - shows code accessing elements and sub-elements<p>To run this, change to the <b>examples\fieldaccess</b> directory and type:
<pre>
&lt;path-to&gt;Scriptloader FieldAccess.xml
</pre>
</li>
<li><a href="examples/enumerate/Enumerate.xml.txt">Enumerate</a> - shows code enumerating elements within an XML element<p>To run this, change to the <b>examples\enumerate</b> directory and type:
<pre>
&lt;path-to&gt;Scriptloader Enumerate.xml
</pre>
</li>
<li><a href="examples/array/Array.xml.txt">Array</a> - shows code using the array index operator to pull out children of an XML element<p>To run this, change to the <b>examples\array</b> directory and type:
<pre>
&lt;path-to&gt;Scriptloader Array.xml
</pre>
</li>
</ul>
<li><a href="examples/demo_xml/Demo_Controller.cpp.txt">Demo_Controller</a> - shows how you can use Simkin within an XML file to construct "on-the-fly" dialog boxes.<p>This example uses <a href="examples/demo_xml/Demo.xml.txt">Demo.xml</a> to describe the dialog.
<p>To run the example, change to the <b>examples\demo_xml</b> directory and type:
<pre>
&lt;path-to&gt;Demo_XML Demo.xml
</pre>
There are versions of this example using the other XML libraries:
<ul>
<li><a href="examples/demo_expat/Demo_Controller.cpp.txt">Expat</a></li>
<li><a href="examples/demo_msxml/Demo_Controller.cpp.txt">Microsoft MSXML</a></li>
</ul>
<p>
</li>
<li><a href="examples/demo/Demo_Controller.cpp.txt">Demo_Controller</a> - is the same example as above, but using the TreeNode file format.<p>This example uses <a href="examples/demo/Demo.s.txt">Demo.s</a> to describe the dialog.
<p>To run the example, change to the <b>examples\demo</b> directory and type:
<pre>
&lt;path-to&gt;Demo Demo.s
</pre>
</li>
<li><a href="examples/inherits/Inherits.cpp.txt">Inherits</a> - shows how you can extend the Simkin classes to provide an "inheritance" feature in your XML files.<p>Other files in this example are:
<ul>
<li><a href="examples/inherits/InheritsElement.h.txt">InheritsElement.h</a></li>
<li><a href="examples/inherits/InheritsElement.cpp.txt">InheritsElement.cpp</a></li>
<li><a href="examples/inherits/InheritsExecutable.h.txt">InheritsExecutable.h</a></li>
<li><a href="examples/inherits/InheritsExecutable.cpp.txt">InheritsExecutable.cpp</a></li>
<li><a href="examples/inherits/child.xml.txt">child.xml</a></li>
<li><a href="examples/inherits/parent.xml.txt">parent.xml</a></li>
</ul>
<p>To run the example, change to the <b>examples\inherits</b> directory and type:
<pre>
&lt;path-to&gt;Inherits child.xml
</pre>
</li>
<li><a href="examples/dynamic_treenode/DynamicTreeNode.cpp.txt">DynamicTreeNode</a> - shows how you can add fields to TreeNodes (and other objects) on-the-fly in your scripts. The object set up in the C++ is called by the script <a href="examples/dynamic_treenode/dynamic.dat.txt">dynamic.dat</a>.
<p>
</li>
<li><a href="examples/cgi/SimkinCGI.cpp.txt">SimkinCGI</a> - shows how you can execute Simkin script within a CGI program. The script is sent to the CGI program via form <a href="examples/cgi/index.html">index.html</a>.
<p>You will need to place the CGI program in the approporiate location for your web server, and modify the URL within the form accordingly.
</li>
</ul>
</body>
</html>
